<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');



class Audit extends MY_Controller{

    public function __construct() {
        parent::__construct();
        log_message('debug', __METHOD__.' - START');
//        $this->output->enable_profiler(TRUE);
//            $config = array(
//                'config'  => TRUE,
//                'queries' => TRUE
//            );
//        $this->output->set_profiler_sections($config);
        
    }
    
    /**
     * Only login user have access on this one
     */
	public function index(){
        
        $this->load->model('audit_model', 'audit');
        
        //landing page
        $this->benchmark->mark('get_audit_start');
        $d['audit'] = $this->audit->get_audit();
        $this->benchmark->mark('get_audit_end');
        
        $d['account_name'] = $this->session->userdata('account_name');
        $d['title'] = "Audit Trails";
        $d['events'] = array(''=> 'Unset event',
            1=>'Add',3=>'Update',4=>'Delete',
            5=>'Login',6=>'Logout',
            7=>'Upload', 8=>'Process',
            9=>'Unlock');
        $d['datahead'] = array(
            'event'=>"Event",
            'comment'=>"Message",
            'date' => 'Date',
            'time' => 'Time',
        );
        
        $views['_tabs'] = 'user/tabs';
        //$views['_userform'] = 'user/user_form';
        $views['_content'] = 'user/audit';
        $this->template->load('user/admin', $views, $d);    

    }
	public function xxx()
	{	
        
        log_message('debug', __METHOD__.' - START');
        // Load the price_range_mode.php
        $this->load->model('audit_model', 'audit');
        
        //landing page
        $this->benchmark->mark('get_audit_start');
        $d['audit'] = $this->audit->get_audit();
        $this->benchmark->mark('get_audit_end');
        
        $d['account_name'] = $this->session->userdata('account_name');
        $d['events'] = array(1=>'Add', 3=>'Update',4=>'Delete');
        $d['datahead'] = array(
            'event'=>"Event",
            'comment'=>"Message",
            'date' => 'Date',
            'time' => 'Time',
        );
        
        $views['_content'] = 'user/audit';
        $this->template->load('user/main', $views, $d);
        log_message('debug', __METHOD__.' - END');
	}

    
    
}
